package com.example.social.api

import com.example.social.model.ThreadModel
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query

interface ThreadApiService {
    @POST("thread/add")
    fun add(@Body threadRequest:ThreadRequest):Call<BaseResponse<String>>
    @POST("thread/listById")
    fun getThreadsById(@Query("uid") uid:String):Call<BaseResponse<List<ThreadModel>>>
    @GET("thread/list")
    fun getAllThread():Call<BaseResponse<List<ThreadList>>>

    @Multipart
    @POST("file/upload")
    fun uploadFile(@Part file: MultipartBody.Part):Call<BaseResponse<String>>

    @POST("thread/listByTid")
    fun getThreadsByTid(@Query("tid") tid: String): Call<BaseResponse<ThreadModel>>

    @POST("thread/listFollowThreadById")
    fun getListFollowThreadById(@Query("userId") uid:String):Call<BaseResponse<List<ThreadList>>>
}